home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 10
/
The PC-Sig Library - Shareware for the IBM PC and Compatibles (PC-SIG)(Tenth Edition Disks 1-2804)(1991).iso
/
PC_SIGCD
/
02
/
8
/
DISK0283.ZIP
/
INT_PORT.DOC
< prev
next >
Wrap
Text File
|
1985-01-29
|
2KB
|
44 lines
The program int.com is not necessarily portable between different
ms-dos machines. The unportability is due to the value of EXTRA in the source.
If int 1Ch was a hardware interupt, the value of EXTRA is 0. But int 1Ch is
usually a software interupt invoked from the timer tick interupt handler
(int 8) and thus int.com must reach deeper into the stack to find the programs
cs:ip values. The value of extra can be found in two ways.
The debugger can be used to look through the interupt code that calls
int 1Ch and the value of EXTRA can be guessed. There are 6 bytes for an
extra interupt, 2 bytes for each push, 16 bytes for a pushall on the 186.
The Tandy 2000 has int 8, a pushall, and 2 pushes in effect so
6+16+(2*2)=26 (=1Ah) is the value of EXTRA.
The IBM has int 8, and 3 pushes in effect so
6+(2*3)=12 (=0Ch) is the value of EXTRA.
Another way is to enter the debugger and type: (The int3 should end up at 113)
a100
cli
mov ax,0
mov ds,ax
mov word [70],113
mov [72],cs
sti
jmp 111
int3
r
g
Now, if everything is working properly, you will have two register dumps
to compare. Subtracting the SP value of the second from the first gives the
number of bytes added to the stack by the interupts. Subtract 6 from this
value to get the value EXTRA should have. (Be sure to do the arithmetic
carefully, The SP values are in hex). By the way, your machine will need
to be rebooted now.
Example:
For the Tandy 2000 the SP=FFEE and FFCE. (hex)
EEh-CEh=20h, 20h-6=1Ah and the value for EXTRA is 1Ah
For the IBM the SP=FFEE and FFDC. (hex)
EEh-DCh=12h, 12h-6=0Ch and the value for EXTRA is 0Ch
Note that int.com only interupts a program when the cs:ip values are
larger than the end of the int.com code and smaller than C0000 (hex).
I don't know whether this is appropriate for all ms-dos machines.